Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Jun 24, 2025

  • Set min numpy version to lowest prebuilt python3.13-compatible release
  • ComponentTracker: Use run_forever with eventloop fixes for _run() loop
  • Actor: Don't restart on RuntimeError:No Running Eventloop
  • Use get_running_loop() instead of str cmp to check for a running event loop
  • cancel_and_wait: Re-raise if it was our task
  • Fix swallowing of cancel error in Formula Engine & Voltage streamer

Copilot AI review requested due to automatic review settings June 24, 2025 10:13
@Marenz Marenz requested a review from a team as a code owner June 24, 2025 10:13
@Marenz Marenz requested review from florian-wagner-frequenz and removed request for a team June 24, 2025 10:13
@github-actions github-actions bot added part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:data-pipeline Affects the data pipeline part:actor Affects an actor ot the actors utilities (decorator, etc.) part:core Affects the SDK core components (data structures, etc.) part:microgrid Affects the interactions with the microgrid labels Jun 24, 2025
@Marenz Marenz added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Jun 24, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR cleans up CI compatibility and refines event loop and cancellation handling across several components.

  • Bump numpy to ≥2.1.0 for Python 3.13 compatibility
  • Propagate CancelledError instead of breaking loops in FormulaEngine and VoltageStreamer
  • Centralize continuous retry loops via run_forever and prevent actor restarts when no running event loop
  • Improve cancel_and_await to re-raise cancellation and abort on missing event loop

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/frequenz/sdk/timeseries/formula_engine/_formula_engine.py Replace break with raise for CancelledError propagation
src/frequenz/sdk/timeseries/_voltage_streamer.py Replace break with raise for CancelledError propagation
src/frequenz/sdk/microgrid/_power_distributing/_component_status/_battery_status_tracker.py Wrap the main loop in run_forever
src/frequenz/sdk/actor/_actor.py Skip restart when no event loop is running
src/frequenz/sdk/_internal/_asyncio.py Refine cancel_and_await, add is_loop_running, abort on missing loop
pyproject.toml Update numpy dependency to >=2.1.0,<3
Comments suppressed due to low confidence (1)

src/frequenz/sdk/actor/_actor.py:109

  • [nitpick] The new branch that skips restarts when no event loop is running should be covered by a unit or integration test to prevent regressions.
                if not is_loop_running():

@Marenz Marenz requested review from llucax and shsms and removed request for florian-wagner-frequenz June 24, 2025 10:16
@Marenz Marenz enabled auto-merge June 24, 2025 10:45
@Marenz Marenz added this pull request to the merge queue Jun 24, 2025
@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap Jun 24, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit 9d617fa Jun 24, 2025
5 checks passed
@Marenz Marenz deleted the cici-mi-fri branch June 24, 2025 12:46
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap Jun 24, 2025
@llucax llucax added this to the v1.0.0-rc2100 milestone Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:actor Affects an actor ot the actors utilities (decorator, etc.) part:core Affects the SDK core components (data structures, etc.) part:data-pipeline Affects the data pipeline part:microgrid Affects the interactions with the microgrid part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

Development

Successfully merging this pull request may close these issues.

3 participants